import fetch from 'utils/fetch';
import Cookies from 'js-cookie';

export function logout(requestParams) {
  const operatorid = Cookies.get('uid');
  const lastlogincode = Cookies.get('lastlogincode')
  Object.assign(requestParams, { operatorid, lastlogincode });
  return fetch({
    url: '/login/logout',
    method: 'post',
    data: JSON.stringify(requestParams),
    headers: {
      'Content-Type': 'application/json'
    }
  });
}

// 用户登录
export function userLogin(requestParams) {
  return fetch({
    url: '/trc-service-system/users/login',
    method: 'post',
    data: JSON.stringify(requestParams),
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

